package v1

import (
	"api-go/serializer"
	v1 "api-go/service/v1/app"
	"fmt"

	"github.com/gin-gonic/gin"
)

// app更新
func AppUpDate(c *gin.Context) {
	var service v1.AppUpdateService
	var res *serializer.Response
	if err := c.ShouldBind(&service); err != nil {
		fmt.Println(err)
		res = serializer.ErrorResponse(serializer.CodeParamError)
	} else {
		res = service.AppUp()
	}
	c.JSON(200, res)
}

//app公告
func AppNotice(c *gin.Context) {
	var service v1.AppNoticeService
	var res *serializer.Response
	if err := c.ShouldBind(&service); err != nil {
		fmt.Println(err)
		res = serializer.ErrorResponse(serializer.CodeParamError)
	} else {
		res = service.AppNotice()
	}
	c.JSON(200, res)
}
